package com.surfilter.massdata.spark.model;

import java.io.Serializable;
import java.util.Arrays;

public class StructDomain implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private String[] fields = new String[DnsStatConsts.DomainExField.size()];
    private String top_domain;

    public StructDomain(String top_domain) {
        Arrays.fill(fields, null);
        this.top_domain = top_domain;
    }

    public StructDomain(String top_domain, String[] args) {
        if (fields.length == args.length) {
            fields = args.clone();
            this.top_domain = top_domain;
        } else
            Arrays.fill(fields, null);
    }

    public void set(int i, String value) {
        fields[i] = value;
    }

    public String get(int i) {
        return fields[i];
    }

    public String toString() {
        return Arrays.toString(fields);
    }

    public String[] getFields() {
        return fields;
    }

	public String getTop_domain() {
		return top_domain;
	}

	public void setTop_domain(String top_domain) {
		this.top_domain = top_domain;
	}

	public void setFields(String[] fields) {
		this.fields = fields;
	}
}

